﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Circle c = new Circle();
            c.GetArea();

            Square s = new Square();
            s.GetArea();
        }
    }
    class Shape
    {
        public string color;
        public void GetColor()
        {

        }

        public virtual void GetArea()
        {
            Console.WriteLine("你要计算的面积");
        }
    }
    class Circle : Shape
    {
        public int aradius;

        public override void GetArea()
        {
            base.GetColor();
            Console.WriteLine("请输入正方形边长");
            aradius = int.Parse(Console.ReadLine());
            Console.WriteLine("正方形面积为:"+aradius * aradius);
        }

    }
    class Square:Shape
    {
        public double sideLen;
        public override void GetArea()
        {
            base.GetArea();
            double pai = 3.14;
            Console.WriteLine("请输入半径");
            sideLen = double.Parse(Console.ReadLine());
            Console.WriteLine("圆的面积为："+pai*(sideLen*sideLen));
        }
    }
}
